package pl.matt.service.impl;

import java.util.Collection;

import pl.matt.media.manager.MediaManagersFactory;
import pl.matt.model.Frame;
import pl.matt.model.FrameRegion;
import pl.matt.model.FrameRegionType;
import pl.matt.model.Rectangle;
import pl.matt.service.ExtractorService;

public class RightEyeExtractorService extends AbstractEyeExtractorService implements ExtractorService {

	@Override
	protected int getDX(Frame frame) {
		FrameRegion faceRegion = getRegion(frame);
		int width = faceRegion.getWidth() / 2;
		int dx = faceRegion.getX() + width;
		return dx;
	}
	
	
	@Override
	protected FrameRegionType getFrameRegionType() {
		return FrameRegionType.RIGHT_EYE;
	}
	
	@Override
	protected Collection<Rectangle> detectRectangles(String imageFilePath) {
		Collection<Rectangle> rectangles = MediaManagersFactory.getObjectsDetectorManager().detectRightEyes(imageFilePath);
		return rectangles;

	}
	
}
